home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 36 / 036.d81 / pixel puzzler (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  240 lines

  1. 100 ifx=0thenx=1:load"text.3.o",8,1
  2. 120 ifx=1thenx=2:load"wilderness.lnk",8,1
  3. 130 ifx=2thenx=3:load"unpacker",8,1
  4. 140 ifx=3thenx=4:load"hand.spr",8,1
  5. 150 :
  6. 160 ni=42
  7. 170 na=6
  8. 180 nd=6
  9. 182 v=53248:rem vic
  10. 185 q9$="                                      "
  11. 190 :
  12. 200 poke249,224:poke250,204:dima%(ni)
  13. 210 sys51459:poke53280,2
  14. 220 poke828,0:poke829,39:poke830,0:poke831,24:sys49152:sys49158,22
  15. 230 :
  16. 235 pokev+21,0
  17. 240 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210] [205][193][201][206] [205][197][206][213]",9,2,0
  18. 242 sys49161,"[194][217] [193][204][193][206] [199][193][210][196][206][197][210]",12,3,0
  19. 245 sys49161,"[208][201][195][203] [217][207][213][210] [205][207][196][197]",13,5,0
  20. 250 sys49161,"--------------",13,6,0
  21. 260 sys49161,"1 ==> [215][201][206][206][197][210]",12,8,0
  22. 270 sys49161,"2 ==> [201][206][212][197][210][205][197][196][201][193][212][197]",12,10,0
  23. 275 sys49161,"3 ==> [204][207][211][197][210]",12,12,0
  24. 280 sys49161,"4 ==> [210][197][212][213][210][206] [212][207] [204][207][193][196][211][212][193][210]",12,14,0
  25. 290 poke198,0:wait198,1:getmo$:mo=val(mo$):ifmo>=1andmo<=4then320
  26. 300 sys49167,1000,33,15,15:fordl=1to1000:next
  27. 310 sys49167,1000,32,0,0:goto290
  28. 320 poke828,1:poke829,38:poke830,1:poke831,23:sys49152:sys49158,1
  29. 330 ifmo=1thenforx=1toni:a%(x)=x:next:cf=1:goto510
  30. 340 ifmo=4then1020
  31. 350 gosub 1680:ifgip=0thensys49161,"[211][200][213][198][198][204][201][206][199] [212][200][197] [208][201][195][212][213][210][197]...",5,11,0
  32. 355 gosub 4000:sys49152
  33. 370 sys49161,"[208][210][197][211][211] '[200]' [198][207][210] [200][197][204][208]",11,23,1
  34. 372 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210]",13,1,1
  35. 410 cf=0
  36. 420 poke1016+52224,24:pokev+39,5:pokev,60:pokev+1,68
  37. 430 pokev+29,0:pokev+23,0:pokev+16,0
  38. 440 pokev+21,1
  39. 450 :
  40. 460 ifgip=1then510
  41. 470 forx=1toni:a%(x)=x:next
  42. 480 forx=1toni:r1=rnd(1)*ni+1:r2=rnd(1)*ni+1:t=a%(r1):a%(r1)=a%(r2)
  43. 490 a%(r2)=t:next
  44. 495 ro=0:co=1
  45. 500 :
  46. 510 gosub 3300 : rem plot them puppies
  47. 600 :
  48. 610 fl=0
  49. 620 forx=0toni-1
  50. 630 ifa%(x+1)<>x+1thenfl=1
  51. 640 ifa%(x+1)=nithenbl=x
  52. 650 next
  53. 660 :
  54. 670 ifcf=1then1530
  55. 680 iffl=0thensys49161,"               [217][207][213] [215][207][206]!!             ",1,0,0:goto1450
  56. 690 j=56320
  57. 700 gosub 1080
  58. 710 a=co+ro*na
  59. 720 br=int(bl/na):bc=bl-na*br:bc=bc+1
  60. 730 ifmo=2anda%(a)<>nithen1600 : rem plop it
  61. 740 if(br<>roandbc<>co)ora%(a)=nithen970
  62. 750 ifbr<>rothen870
  63. 760 if bc>cothenb=bc:e=co+1:i=-1
  64. 770 if bc<cothenb=bc:e=co-1:i=1
  65. 780 forx=btoestepi
  66. 790 t=ro*na+x:f=ro*na+x+i
  67. 800 a%(t)=a%(f)
  68. 810 poke254,2+ro*3:poke253,x*5:poke255,a%(t)-1:sys51462
  69. 820 poke254,2+ro*3:poke253,(x+i)*5:poke255,ni-1:sys51462
  70. 830 next
  71. 840 ag=3.34:a%(ro*na+x)=ni
  72. 850 goto 610
  73. 860 :
  74. 870 ifbc<>cothen960
  75. 880 ifbr>rothenb=br:e=ro+1:i=-1
  76. 890 ifbr<rothenb=br:e=ro-1:i=1
  77. 900 forx=btoestepi
  78. 910 t=x*na+co:f=(x+i)*na+co:a%(t)=a%(f)
  79. 920 poke253,co*5:poke254,2+x*3:poke255,a%(t)-1:sys51462
  80. 930 poke253,co*5:poke254,2+(x+i)*3:poke255,ni-1:sys51462
  81. 940 ag=3.34:next
  82. 950 a%(x*na+co)=ni:goto610
  83. 960 :
  84. 970 sys49161,"[201][204][204][197][199][193][204] [205][207][214][197]",13,0,0:sys49167,1000,33,15,15
  85. 980 fordl=1to500:next:sys49167,0,32,0,0
  86. 990 sys49161,q9$,0,0,0
  87. 1000 goto 700
  88. 1010 :
  89. 1020 pokev+21,0:pokev+16,0:print"[147]":sys51459
  90. 1030 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  91. 1040 ifer<>63thenend
  92. 1050 load"hello connect",8
  93. 1060 end
  94. 1070 :
  95. 1080 rem read keyboard and joystick
  96. 1090 ifpeek(198)=0andpeek(j)=127then1090
  97. 1100 geta$:js=peek(j):ifjs=111ora$=chr$(13)thenreturn
  98. 1110 cf=0:ifa$="w"thenforx=1toni:a%(x)=x:next:cf=1:goto510
  99. 1115 ifa$="h"thengosub3000:goto510
  100. 1120 ifa$="m"thengosub1320:goto1090
  101. 1130 ifa$="s"thengosub1980:goto1090
  102. 1135 ifa$="v"thengosub4000:goto1090
  103. 1140 ifa$=""orjs=119thenco=co+1
  104. 1150 ifa$="[157]"orjs=123thenco=co-1
  105. 1160 ifa$=""orjs=125thenro=ro+1
  106. 1170 ifa$="[145]"orjs=126thenro=ro-1
  107. 1180 ifjs=118thenco=co+1:ro=ro-1
  108. 1190 ifjs=117thenco=co+1:ro=ro+1
  109. 1200 ifjs=121thenco=co-1:ro=ro+1
  110. 1210 ifjs=122thenco=co-1:ro=ro-1
  111. 1220 :
  112. 1230 ifco<1thenco=1
  113. 1240 ifro<0thenro=0
  114. 1250 ifro>ndthenro=nd
  115. 1260 ifco>nathenco=na
  116. 1270 :
  117. 1280 pokev,21+co*39:pokev+1,68+ro*24:pokev+16,0
  118. 1290 goto1090
  119. 1300 :
  120. 1310 :
  121. 1320 rem  quit
  122. 1330 sys49161,"   [196][207] [217][207][213] [215][193][206][212] [212][207] [209][213][201][212] [212][200][201][211] [208][213][218][218][204][197]?   ",1,0,0
  123. 1340 forx=1to100:ifpeek(198)=0thennextx
  124. 1350 ifpeek(198)<>0then1410
  125. 1360 sys49161,q9$,0,0,0
  126. 1370 fory=1to100:ifpeek(198)=0thennexty
  127. 1380 ifpeek(198)<>0then1410
  128. 1390 goto1330
  129. 1400 :
  130. 1410 geta$
  131. 1420 ifa$<>"y"thensys49161,q9$,0,0,0:return
  132. 1430 :
  133. 1440 goto1540
  134. 1445 :
  135. 1450 rem win
  136. 1460 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
  137. 1470 forx=1000to20000step500:sys49167,x,33,15,15:next
  138. 1480 forx=1000to20000step500:sys49167,x,33,15,15:next
  139. 1490 forx=1000to20000step500:sys49167,x,33,15,15:next
  140. 1500 sys49167,0,32,0,0
  141. 1510 fordl=1to100:nextdl
  142. 1520 :
  143. 1530 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
  144. 1540 sys49161,"      [196][207] [217][207][213] [215][193][206][212] [212][207] [208][204][193][217] [193][199][193][201][206]?   ",1,0,0
  145. 1550 poke198,0:wait198,1
  146. 1560 geta$:ifa$="y"then220
  147. 1570 ifa$<>"n"then1550
  148. 1580 goto1020
  149. 1590 :
  150. 1600 rem plop it
  151. 1610 ifa%(a)=nithen870
  152. 1620 t=a%(a):a%(a)=a%(bl+1):a%(bl+1)=t
  153. 1630 poke254,2+ro*3:poke253,co*5
  154. 1640 poke255,ni-1:sys51462:ag=3.34
  155. 1650 poke254,2+br*3:poke253,bc*5
  156. 1660 poke255,t-1:sys51462:ag=3.34
  157. 1670 goto610
  158. 1680 rem  game in progress
  159. 1690 gip=0:pokev+21,0
  160. 1700 sys49161,"[215][207][213][204][196] [217][207][213] [204][201][203][197] [212][207] [204][207][193][196] [193]",10,10,0
  161. 1710 sys49161,"[199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]?",10,12,0
  162. 1720 poke198,0:wait198,1:geta$:ifa$<>"y"then1785
  163. 1730 :
  164. 1740 f$="pp.gip"
  165. 1745 sys49161,"[204][207][193][196][201][206][199] [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]...",4,20,0
  166. 1750 gip=1
  167. 1760 open2,8,2,f$
  168. 1770 forx=1toni:input#2,a%(x):next
  169. 1780 close2
  170. 1785 sys49152
  171. 1790 pokev+21,1:return
  172. 1970 :
  173. 1980 rem save gip
  174. 1990 rem
  175. 2000 sys49161,"[211][193][214][201][206][199] [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]...",7,0,0
  176. 2010 open15,8,15,"i0":print#15,"s0:pp.gip":close15
  177. 2020 :
  178. 2030 f$="0:pp.gip,s,w"
  179. 2040 open2,8,2,f$
  180. 2050 forx=1toni
  181. 2060 print#2,a%(x)
  182. 2070 next
  183. 2080 close2
  184. 2090 sys49161,q9$,0,0,0
  185. 2100 return
  186. 3000 rem help
  187. 3010 pokev+21,0
  188. 3015 poke828,1:poke829,38:poke830,1:poke831,23:sys49152:sys49158,1
  189. 3020 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210]",13,3,0
  190. 3030 sys49161,"[212][207] [205][207][214][197] [212][200][197] [200][193][206][196], [213][211][197] [212][200][197] [195][213][210][211][207][210]",4,5,0
  191. 3040 sys49161,"[203][197][217][211] [207][210] [212][200][197] [202][207][217][211][212][201][195][203] ([201][206] [208][207][210][212] 2).",2,6,0
  192. 3050 sys49161,"[215][200][197][206] [212][200][197] [200][193][206][196] [201][211] [207][206] [212][200][197] [208][201][197][195][197]",4,8,0
  193. 3060 sys49161,"[217][207][213] [215][201][211][200] [212][207] [205][207][214][197], [208][210][197][211][211] [210][197][212][213][210][206] [207][210]",2,9,0
  194. 3062 sys49161,"[212][200][197] [198][201][210][197][194][213][212][212][207][206].",2,10,0
  195. 3080 sys49161,"[212][207] [211][193][214][197] [193] [199][193][205][197], [208][210][197][211][211] '[211]'",2,12,0
  196. 3090 sys49161,"[212][207] [199][197][212] [212][207] [212][200][197] [205][197][206][213], [208][210][197][211][211] '[205]'",2,14,0
  197. 3092 sys49161,"[212][207] [214][201][197][215] [212][200][197] [197][206][212][201][210][197] [208][201][195][212][213][210][197], [208][210][197][211][211] '[214]'",2,16,0
  198. 3094 sys49161,"[208][210][197][211][211] [193] [203][197][217] [212][207] [195][207][206][212][201][206][213][197].",7,21,0
  199. 3095 :
  200. 3100 :
  201. 3102 pokev+21,0
  202. 3110 poke198,0:wait198,1:poke198,0:pokev+21,1
  203. 3120 poke828,1:poke829,38:poke830,1:poke831,23:sys49152:sys49158,1
  204. 3125 poke828,1:poke829,38:poke830,1:poke831,23
  205. 3127 sys49161,"[208][210][197][211][211] '[200]' [198][207][210] [200][197][204][208]",11,23,1
  206. 3128 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210]",13,1,1
  207. 3130 return
  208. 3200 :
  209. 3300 rem  plot the